<template>
    <div class="container">
        <h5>ref</h5>
   <div>{{name}}</div>
    <div>{{age}}</div>
    <button @click="updateName">修改数据</button>
  </div>
    </div>
</template>
<script>
import {ref} from 'vue'
export default{
    name: 'ref',
    setup(){
           const name = ref('ls')
    const updateName = () => {
      name.value = 'zs'
    }
    // 2. age数据
    const age = ref(10)

    return {name, age, updateName}
    }
}
</script>